package com.example.permissionservice.common;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    //全局捕获运行时异常
    @ExceptionHandler(RuntimeException.class)
    public Result<?> handleException(RuntimeException e) {
        return Result.failure(e.getMessage());
    }
}
